libxl: Further fix exit paths from libxl_device_events_handler
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 10 Feb 2015 20:09:48 +0000 (20:09 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 30 Mar 2015 08:35:00 +0000 (09:35 +0100)
commit62cba1bec4222e9b4882a7ecbcb92e55659a6baa
treedf85faa6802dff8b48154cfa8fb3171ab25c2be6
parent624de4dfb43827bd48cf4e683a98dc4ddc1056f5
libxl: Further fix exit paths from libxl_device_events_handler

On the success path, do not call GC_FREE explicitly.  Instead, call
AO_INPROGRESS.

GC_FREE will free the gc underlying the long-term ao, which is then
subsequently referenced in backend_watch_callback's call to
libxl__nested_ao_create.  It is a miracle that this ever works at all.

Also, add an `if (rc) goto out;' after the xswatch registration.

After this, libxl_device_events_handler has the conventional and
correct ao initiation pattern.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c